package com.yjd.bi.report.dao.impl;

import java.util.List;

import org.springframework.stereotype.Component;
import com.yjd.comm.base.dao.impl.BaseDaoImpl;
import com.yjd.comm.util.FrameUtil;
import com.yjd.bi.report.model.BiDataChangeRecordLogModel;
import com.yjd.bi.report.dao.IBiDataChangeRecordLogDao;

/**
 * <b>description</b>：数据变更记录日志,此数据来源于yjd_bi_data_change_record表数据访问层 <br>
 * <b>time</b>：2016-04-08 15:30:24 <br>
 * <b>author</b>： ready likun_557@163.com
 */
@Component("biDataChangeRecordLogDao")
public class BiDataChangeRecordLogDaoImpl extends BaseDaoImpl implements
		IBiDataChangeRecordLogDao {

	/**
	 * 将yjd_bi_data_change_record表中指定的数据拷贝到yjd_bi_data_change_record表
	 * 
	 * @param biDataChangeRecordIds
	 * @throws Exception
	 */
	public void copyBiDataChangeRecordToLog(List<Long> biDataChangeRecordIds)
			throws Exception {
		if (biDataChangeRecordIds != null && !biDataChangeRecordIds.isEmpty()) {
			this.getSqlMap().insert(
					this.getStatement("copyBiDataChangeRecordToLog"),
					FrameUtil.newHashMap("biDataChangeRecordIds",
							biDataChangeRecordIds));
		}
	}

	private static final String SQLMAPNAMESPACE = BiDataChangeRecordLogModel.class
			.getName();
	private static final String PKNAME = "id";

	@Override
	public String getPrimaryKeyName() {
		return PKNAME;
	}

	@Override
	public String getSqlmapNamespace() {
		return SQLMAPNAMESPACE;
	}

}
